//
//  CashFlowModel.swift
//
//  Created by 邱仙凯 on 2020/3/31
//  Copyright (c) . All rights reserved.
//

import Foundation
import ObjectMapper

public class ZyaCashFlowModel: Mappable {

  // MARK: Declaration for string constants to be used to decode and also serialize.
  private struct SerializationKeys {
    static let rn = "rn"
    static let auditMark = "audit_mark"
    static let zDate = "z_date"
    static let idKey = "id_key"
    static let zMoney = "z_money"
  }

  // MARK: Properties
  public var rn: Int?
  public var auditMark: String?
  public var zDate: String?
  public var idKey: Int?
  public var zMoney: String?

  // MARK: ObjectMapper Initializers
  /// Map a JSON object to this class using ObjectMapper.
  ///
  /// - parameter map: A mapping from ObjectMapper.
  public required init?(map: Map){

  }

  /// Map a JSON object to this class using ObjectMapper.
  ///
  /// - parameter map: A mapping from ObjectMapper.
  public func mapping(map: Map) {
    rn <- map[SerializationKeys.rn]
    auditMark <- (map[SerializationKeys.auditMark],StringTransform())
    zDate <- map[SerializationKeys.zDate]
    idKey <- map[SerializationKeys.idKey]
    zMoney <- map[SerializationKeys.zMoney]
  }

  /// Generates description of the object in the form of a NSDictionary.
  ///
  /// - returns: A Key value pair containing all valid values in the object.
  public func dictionaryRepresentation() -> [String: Any] {
    var dictionary: [String: Any] = [:]
    if let value = rn { dictionary[SerializationKeys.rn] = value }
    if let value = auditMark { dictionary[SerializationKeys.auditMark] = value }
    if let value = zDate { dictionary[SerializationKeys.zDate] = value }
    if let value = idKey { dictionary[SerializationKeys.idKey] = value }
    if let value = zMoney { dictionary[SerializationKeys.zMoney] = value }
    return dictionary
  }

}
